<#ftl strip_whitespace=true>

<#macro drawBreadCrumb title1="" title2="" title3="" title4=""><!-- 渲染头HTML -->
<div class="padding-0">
    <ul class="page-breadcrumb breadcrumb">
        <li>
           <i class="fa fa-home"></i>
           <span href="#">首页</span> 
           <#if title1 != "">
           <i class="fa fa-angle-right"></i>
           <span href="#">${title1}</span>
           </#if>
           <#if title2 != "">
           <i class="fa fa-angle-right"></i>
           <span href="#">${title2}</span>
           </#if>
           <#if title3 != "">
           <i class="fa fa-angle-right"></i>
           <span href="#">${title3}</span>
           </#if>
           <#if title4 != "">
           <i class="fa fa-angle-right"></i>
           <span href="#">${title4}</span>
           </#if>
        </li>
   </ul>
</div>
</#macro>


<#macro drawOptionList list=[] left="" right="" value="" withOutDefault="" customerAttributePlusValue="">
	<#if withOutDefault=""><option value="">请选择</option></#if><#list list as item><#if item[left]?exists && item[right]?exists><option value="${item[left]}" <#if customerAttributePlusValue?exists>${customerAttributePlusValue}${item[left]}Selected </#if> <#if item[left]==value?string>selected="selected"</#if>>${item[right]}</option></#if></#list></#macro>

<#macro drawOptionMap map={} value="" default="">
	<#if default!=""><option value="">${default}</option></#if>
	<#list map?keys as key>
		<#if key?exists && map[key]?exists>
			<option value="${key}"  <#if key==value>selected="selected"</#if>>${map[key]}</option>
		</#if>
	</#list>
</#macro>

<#-- 自定义的提交公共提交Hidden字段 (powered by guyifeng)-->
<#macro modelAttribute name="">
    <#if name!="">
        <input type="hidden" name="version" value="${name.version}">
    </#if>
</#macro>

<#macro commonApproveDiv>
	<div class="form-group clearfix margin-top-20">
			<div class="container">
				<div class="col-center-block col-md-6">
					<label class="control-label col-md-6">审批意见：</label>
					</br>
					<textarea class="form-control"  id="approveComment" name="approveComment" value=""></textarea>
				</div>		
			</div> 			
		</div>	
	</div>
	<div class="form-group clearfix margin-top-20 ">
			<div class="container">
				<div class="col-center-block col-md-4">
					<button type="button" class="btn green" onclick="approvePass();"   ><i class="fa fa-check"></i> 审核通过</button>
					<button type="button" class="btn green" onclick="approveReject();"  ><i class="fa fa-circle-o"></i> 审核驳回</button>
					<button type="button" class="btn green" onclick="approveCancel();"><i class="fa fa-arrow-left"></i> 取消</button>
					<input type="hidden" id="approveResult" name="approveResult" value="">
				</div>		
			</div> 						
	</div>
</#macro>


<#--
	使用说明:   使用时定义的参数必输全部给出   通用显示组件
	如果有特殊需要此组件可以扩展(公共使用)
	<@componentBoDiv bo=salesRebate boCode="salesRebateNo" boText="返利单号：" isReadonly="false" isRequired="" />
-->
<#macro componentBoDiv bo boCode boText isReadonly isRequired>
	       	<div class="col-md-4">
                <label class="control-label col-md-4 text-right"><#if isRequired != ""><strong style="color: red"> *</strong></#if>${boText}</label>
                <div class="col-md-8 padding-left-0">
                    <input type="text" class="form-control <#if isRequired != ''>${isRequired}</#if>"  id="${boCode}" name="${boCode}" value="<#if bo[boCode]>${bo[boCode]}</#if>" <#if isReadonly="true"> readonly </#if> >
                </div>
            </div>
</#macro>

<#--       
	使用说明:   使用时定义的参数必输全部给出  选择组件
	功能说明           通过点击自动带出属性参数
	如果有特殊需要此组件可以扩展(公共使用)
	使用案例
    <@componentBoOnChickDiv bo=salesRebate boName="customerName" boText="客户：" boId="customerId"  mOnClick="openCustomerQuery();" mButtenClass="fa fa-search" isReadonly="true" isDisabledButton="false" isRequired="" /> 
 -->
<#macro componentBoOnChickDiv bo boName boText boId mOnClick mButtenClass isReadonly isDisabledButton isRequired>
            <div class="col-md-4">
                <label class="control-label col-md-4 text-right"><#if isRequired != ""><strong style="color: red"> *</strong></#if>${boText}</label>
                <div class="col-md-6 padding-left-0">
                    <input type="text" class="form-control <#if isRequired != ''>${isRequired}</#if>"  id="${boName}" name="${boName}" value="<#if bo[boName]>${bo[boName]}</#if>" <#if isReadonly="true"> readonly </#if>  />
                </div>
                <#if isDisabledButton != "true">  
	                <div class="col-md-2 padding-left-0">
	                    <button type="button" class="btn blue" onclick="${mOnClick}"><i class="${mButtenClass}"></i></button>
	                </div>
                </#if> 
                <input type="hidden" id="${boId}" name="${boId}" value="<#if bo[boId]>${bo[boId]}</#if>" />
            </div>     
</#macro>


<#--       
	使用说明:   使用时定义的参数必输全部给出  单日期组件默认YYYY-MM-DD
	功能说明           单日期组件选择    通用组件
	如果有特殊需要此组件可以扩展(公共使用)
	使用案例
    <@componentBoSimpleDate bo=salesRebate boCode="activeDate" boText="生效日期：" isReadonly="false" isRequired="isActiveDateLessCurrentDate required" /> 
 -->
<#macro componentBoSimpleDate bo boCode boText isReadonly isRequired >
		<div class="col-md-4">
                <label class="col-md-4 control-label text-right"><#if isRequired != ""><strong style="color: red"> *</strong></#if>${boText}</label>
                <div class="col-md-8 padding-left-0">
                    <div class="input-group date-picker date"  data-date-format="yyyy-mm-dd" >
                        <input type="text" id="${boCode}" name="${boCode}" class="form-control <#if isRequired != ''>${isRequired}</#if>" 
                               value="<#if bo[boCode]>${bo[boCode]?string('yyyy-MM-dd')}</#if>" <#if isReadonly="true"> readonly </#if> >
                    	<span class="input-group-btn"></span>
                    </div>
                </div>
		</div>  
</#macro>

<#--       
	使用说明:   使用时定义的参数必输全部给出  日期区间组件默认日期类型YYYY-MM-DD
	功能说明            日期区间组件   通用组件  默认日期类型YYYY-MM-DD
	如果有特殊需要此组件可以扩展(公共使用)
	使用案例
    <@componentBoIntervalDate bo=salesRebate boDateStart="activeDateStart" boDateEnd="activeDateEnd" boText="生效日期：" isReadonly="false" isRequired="" /> 
 -->
<#macro componentBoIntervalDate bo boDateStart boDateEnd boText isReadonly isRequired >
	    <div class="col-md-4">
                <label class="col-md-4 control-label text-right"><#if isRequired != ""><strong style="color: red"> *</strong></#if>${boText}</label>
                <div class="col-md-8 padding-left-0">
                    <div class="input-group date-picker input-daterange"  data-date-format="yyyy-mm-dd">
                        <input type="text" id="${boDateStart}" name="${boDateStart}" class="form-control <#if isRequired != ''>${isRequired}</#if>"
                               value="<#if bo[boDateStart]>${bo[boDateStart]?string('yyyy-MM-dd')}</#if>">

                        <span class="input-group-addon">至</span>
                        <input type="text" id="${boDateEnd}" name="${boDateEnd}" class="form-control <#if isRequired != ''>${isRequired}</#if>" 
                        		value="<#if bo[boDateEnd]>${bo[boDateEnd]?string('yyyy-MM-dd')}</#if>">
                    </div>
              </div>
         </div>   
</#macro>

<#--       
	使用说明:   使用时定义的参数必输全部给出  日期区间组件默认日期类型YYYY-MM-DD
	功能说明            日期区间组件   通用组件  默认日期类型YYYY-MM-DD
	如果有特殊需要此组件可以扩展(公共使用)
	使用案例
    <@componentBoIntervalString bo=salesRebate boDateStart="activeDateStart" boDateEnd="activeDateEnd" boText="生效日期：" isReadonly="false" isRequired="" /> 
 -->
<#macro componentBoIntervalString bo boDateStart boDateEnd boText isReadonly isRequired >
	    <div class="col-md-4">
                <label class="col-md-4 control-label text-right"><#if isRequired != ""><strong style="color: red"> *</strong></#if>${boText}</label>
                <div class="col-md-8 padding-left-0">
                    <div class="input-group date-picker input-daterange"  data-date-format="yyyy-mm-dd">
                        <input type="text" id="${boDateStart}" name="${boDateStart}" class="form-control <#if isRequired != ''>${isRequired}</#if>"
                               value="<#if bo[boDateStart]>${bo[boDateStart]}</#if>">

                        <span class="input-group-addon">至</span>
                        <input type="text" id="${boDateEnd}" name="${boDateEnd}" class="form-control <#if isRequired != ''>${isRequired}</#if>" 
                        		value="<#if bo[boDateEnd]>${bo[boDateEnd]}</#if>">
                    </div>
              </div>
         </div>   
</#macro>

<#--       
	使用说明:   使用时定义的参数必输全部给出  
	功能说明            选择组件   通用组件
	如果有特殊需要此组件可以扩展(公共使用)
	使用案例
    <@componentBoSelectDiv  bo=materialInvoicingDetail boName="transactionType" boText="事务类型: " boId="transactionType" boList=transactionType isReadonly="false" isRequired="" isDisabled="false" />
 -->
 <#macro componentBoSelectDiv bo boName boText boId boList isReadonly isRequired isDisabled>
	            <div class="col-md-4">
	                <label class="control-label col-md-4 text-right"><#if isRequired != ""><strong style="color: red"> *</strong></#if>${boText}</label>
	                <div class="col-md-8 padding-left-0">
	                    <select id="${boId}" name="${boName}" class="form-control select2me <#if isRequired != ''>${isRequired}</#if>" <#if isReadonly = 'true'> readonly </#if>   <#if isDisabled = 'true'> disabled="disabled" </#if>   >
	                        <#--<option value="-1">请选择</option>-->
	                        <#if boList?exists>
	                        	<#if bo != "">
	                            	<@drawOptionList list=boList left="value" right="name" value="${bo[boId]}"/>
	                        	<#else>
	                        		<@drawOptionList list=boList left="value" right="name" value="${boId}"/>
	                        	</#if>
	                        </#if>
	                    </select>
		             </div>
	            </div>   	
</#macro>

<#--       
	使用说明:   使用时定义的参数必输全部给出  
	功能说明            选择组件   通用组件
	如果有特殊需要此组件可以扩展(公共使用)
	使用案例
    <@componentChannelSelectDiv  bo=materialInvoicingDetail boName="transactionType" boText="事务类型: " boId="transactionType" boList=transactionType isReadonly="false" isRequired="" isDisabled="false" />
 -->
 <#macro componentChannelSelectDiv bo boName boText boId boList isReadonly isRequired isDisabled>
	            <div class="col-md-4">
	                <label class="control-label col-md-4 text-right"><#if isRequired != ""><strong style="color: red"> *</strong></#if>${boText}</label>
	                <div class="col-md-8 padding-left-0">
	                    <select id="${boId}" name="${boName}" class="form-control select2me <#if isRequired != ''>${isRequired}</#if>" <#if isReadonly = 'true'> readonly </#if>   <#if isDisabled = 'true'> disabled="disabled" </#if>   >
	                        <#--<option value="-1">请选择</option>-->
	                        <#if boList?exists>
	                        	<#if bo != "">
	                            	<@drawOptionList list=boList left="value" right="name" value="${bo[boId]}" withOutDefault="true"/>
	                        	<#else>
	                        		<@drawOptionList list=boList left="value" right="name" value="${boId}" withOutDefault="true"/>
	                        	</#if>
	                        </#if>
	                    </select>
		             </div>
	            </div>   	
</#macro>

<#macro newdrawOptionList list=[] left="" right="" value="" withOutDefault="" customerAttributePlusValue="">
	<#list list as item><#if item[left]?exists && item[right]?exists><option value="${item[left]}" <#if customerAttributePlusValue?exists>${customerAttributePlusValue}${item[left]}Selected </#if> <#if item[left]==value?string>selected="selected"</#if>>${item[right]}</option></#if></#list>
</#macro>

<#macro commonBatchApproveDiv>
	<div class="form-group clearfix margin-top-20">
			<div class="container">
				<div class="col-center-block col-md-6">
					<label class="control-label col-md-6">审批意见：</label>
					</br>
					<textarea class="form-control"  id="approveComment" name="approveComment" value=""></textarea>
				</div>		
			</div> 			
		</div>	
	</div>
	<div class="form-group clearfix margin-top-20 ">
			<div class="container">
				<div class="col-center-block col-md-4">
					<button type="button" class="btn green" onclick="approveBatchPass();"   ><i class="fa fa-check"></i> 审核通过</button>
					<button type="button" class="btn green" onclick="approveBatchReject();"  ><i class="fa fa-circle-o"></i> 审核驳回</button>
					<button type="button" class="btn green" onclick="approveCancel();"><i class="fa fa-arrow-left"></i> 取消</button>
					<input type="hidden" id="approveResult" name="approveResult" value="">
				</div>		
			</div> 						
	</div>
</#macro>